<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <script src="./JS/vue.global.js"></script>
  </head>
  <body>
    <div id="app">
      <h2>Hello, {{ message}}</h2>
      <button v-on:click="showInfo1">提示信息1</button>
      <button @click="showInfo2(66)">提示信息2</button>
    </div>

    <script>
      Vue.createApp({
        data() {
          return {
            message: "wrod",
          };
        },
        methods: {
          showInfo1(event) {
            alert("你好1");
            // console.log(this); //此处的this时vm

            // console.log(event.target.innerText);
          },
          showInfo2(number) {
            // alert("你好2");
            console.log(number);

            // console.log(this); //此处的this时vm

            // console.log(event.target.innerText);
          },
        },
      }).mount("#app");
    </script>
  </body>
</html>
